package com.lonely.order.support.print.skcsticker;

import cn.hutool.extra.spring.SpringUtil;
import com.lonely.common.enums.PrintEnum;
import com.lonely.common.exception.BusinessException;

/**
 * @author : 黄志标
 * @date: 2025/10/10 11:41
 * @description: 打印skc贴纸pdf工厂
 */
public class PrintSkcStickerPdfFactory {

    /**
     * 获取打印服务
     *
     * @param type
     * @return
     */
    public static PrintSkcStickerPdfService getInstance(int type) {
        PrintEnum.PrintType byType = PrintEnum.PrintType.getByType(type);
        switch (byType) {
            case ONE_DIMENSIONAL_CODE:
                return SpringUtil.getBean(PrintOneDimensionalCodeSkcStickerPdfServiceImpl.class);
            case QR_CODE:
                return SpringUtil.getBean(PrintQrCodeSkcStickerPdfServiceImpl.class);
            default:
                throw new BusinessException("打印类型错误");
        }
    }

}
